package com.hebeu.device.controller;


import ch.qos.logback.core.net.server.Client;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import com.hebeu.device.pojo.*;
import com.hebeu.device.service.DClientService;
import com.hebeu.device.service.DMaintenanceService;
import com.hebeu.device.service.DPayoffService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("/supervision/")
public class SupervisionController   {
    @Resource
    private DMaintenanceService dMaintenanceService;
    @Resource
    private DPayoffService dPayoffService;
    @Resource
    private DClientService dClientService;


    //查询DMaintenance表
    @RequestMapping("findDMaintenanceList")
    public PageInfo<DMaintenance> findDMaintenanceList(DMaintenance dMaintenance){
        List<DMaintenance> dMaintenanceList=dMaintenanceService.selectDMaintenanceList(dMaintenance);
        PageInfo<DMaintenance> dMaintenancePageInfo=new PageInfo<>(dMaintenanceList);
        return dMaintenancePageInfo;
    }

    //查询结算清单Payoff表
    @RequestMapping("/findDPayoffList")
    public PageInfo<DPayoff> findDPayoffList(DPayoff dPayoff){
        List<DPayoff> dPayoffList = dPayoffService.selectDPayoff(dPayoff);
        PageInfo<DPayoff> dPayoffPageInfo = new PageInfo<>(dPayoffList );
        return dPayoffPageInfo;
    }

    //查询客户信息表Client
    @RequestMapping("/findClientList")
    public PageInfo<DClient> findClientList(DClient dClient){
        System.out.println("supervision进入查询客户信息的方法");
        List<DClient> dClientList=dClientService.findDClientList(dClient);
        PageInfo<DClient> dClientPageInfo=new PageInfo<>(dClientList);
        return dClientPageInfo;
    }




}
